package com.base.leetcode;

import lombok.Data;

/**
 * @Author: hdhao
 * @Create: 2023/4/1 - 13:28
 * @Version: v1.0
 */
//二叉树节点类
@Data
public class TreeNode {
    int val;    //节点值
    TreeNode left;  //左节点
    TreeNode right; //右节点

    public TreeNode(int val) {
        this.val = val;
    }

    public TreeNode(int val, TreeNode left, TreeNode right) {
        this.val = val;
        this.left = left;
        this.right = right;
    }

    @Override
    public String toString() {
        return String.valueOf(this.val);
    }
}
